package org.grow.swimming.entity;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.ToString;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @Author: xwg
 * @CreateDate: 2022/5/6
 */


@Entity
@Data
@ToString(exclude = {"shoppingBill"})
@IdClass(ShoppingBillItemCID.class)
public class ShoppingBillItem implements Serializable {
    @Id
    private String shoppingBillFk;
    @ManyToOne()
    @JoinColumn(name = "shoppingBillFk")
    @MapsId("shoppingBillFk")
    @JsonIgnore
    private ShoppingBill shoppingBill;
    @Id
    private Integer itemIndex;

    private String goodsCode;
    private String goodsName;
    private BigDecimal goodsPrice;
    private BigDecimal quantity;
}